/**
 * 对勾图标
 * @param ratio 画布大小比例
 * @param color 颜色
 * @returns 数据地址
 */
const TickImage = (radio?: number, color?: string) => {
    const r = radio || 1;
    const col = color || '#ffffff';
    const canvas = document.createElement('canvas');
    canvas.width = canvas.height = 40 * r;
    const ctx = canvas.getContext('2d')!;

    ctx.save();
    ctx.strokeStyle = "rgba(0,0,0,0)";
    ctx.miterLimit = 4;
    ctx.fillStyle = col;
    ctx.scale(0.0385, 0.0385);
    ctx.save();
    ctx.beginPath();
    ctx.moveTo(913.017 * r, 237.02 * r);
    ctx.bezierCurveTo(887.706 * r, 211.708 * r, 846.668 * r, 211.708 * r, 821.3570000000001 * r, 237.02 * r);
    ctx.lineTo(408.88200000000006 * r, 649.494 * r);
    ctx.lineTo(202.64500000000007 * r, 443.25700000000006 * r);
    ctx.bezierCurveTo(177.333 * r, 417.94500000000005 * r, 136.29500000000007 * r, 417.94500000000005 * r, 110.984 * r, 443.257 * r);
    ctx.bezierCurveTo(85.67300000000006 * r, 468.5690000000001 * r, 85.67200000000007 * r, 509.6070000000001 * r, 110.98400000000007 * r, 534.917 * r);
    ctx.lineTo(363.05100000000004 * r, 786.984 * r);
    ctx.bezierCurveTo(363.78000000000003 * r, 787.714 * r, 364.49000000000007 * r, 788.3860000000001 * r, 365.18500000000006 * r, 789.013 * r);
    ctx.bezierCurveTo(390.6190000000001 * r, 812.27 * r, 430.09800000000007 * r, 811.5980000000001 * r, 454.71200000000005 * r, 786.984 * r);
    ctx.lineTo(913.015 * r, 328.68100000000004 * r);
    ctx.bezierCurveTo(938.3280000000001 * r, 303.369 * r, 938.3280000000001 * r, 262.331 * r, 913.016 * r, 237.02 * r);
    ctx.closePath();
    ctx.fill();
    ctx.stroke();
    ctx.restore();

    return canvas.toDataURL('image/png');
}


export { TickImage };